|
|
@@ -4,18 +4,13 @@ class @AgentShowPage
|
4
|
4
|
$(".agent-show #show-tabs a[href='#logs'], #logs .refresh").on "click", @fetchLogs
|
5
|
5
|
$(".agent-show #logs .clear").on "click", @clearLogs
|
6
|
6
|
$(".agent-show #memory .clear").on "click", @clearMemory
|
|
7
|
+ $('#toggle-memory').on "click", @toggleMemory
|
7
|
8
|
|
8
|
9
|
# Trigger tabs when navigated to.
|
9
|
10
|
if tab = window.location.href.match(/tab=(\w+)\b/i)?[1]
|
10
|
11
|
if tab in ["details", "logs"]
|
11
|
12
|
$(".agent-show .nav-pills li a[href='##{tab}']").click()
|
12
|
13
|
|
13
|
|
- $('#toggle-memory').click ->
|
14
|
|
- if $('#memorypanel').hasClass('hidden')
|
15
|
|
- $('#memorypanel').removeClass 'hidden'
|
16
|
|
- else
|
17
|
|
- $('#memorypanel').addClass 'hidden'
|
18
|
|
-
|
19
|
14
|
fetchLogs: (e) ->
|
20
|
15
|
agentId = $(e.target).closest("[data-agent-id]").data("agent-id")
|
21
|
16
|
e.preventDefault()
|
|
|
@@ -47,6 +42,13 @@ class @AgentShowPage
|
47
|
42
|
$("#logs .spinner").stop(true, true).fadeOut ->
|
48
|
43
|
$("#logs .refresh, #logs .clear").show()
|
49
|
44
|
|
|
45
|
+ toggleMemory:(e) ->
|
|
46
|
+
|
|
47
|
+ if $('#memorypanel').hasClass('hidden')
|
|
48
|
+ $('#memorypanel').removeClass 'hidden'
|
|
49
|
+ else
|
|
50
|
+ $('#memorypanel').addClass 'hidden'
|
|
51
|
+
|
50
|
52
|
clearMemory: (e) ->
|
51
|
53
|
|
52
|
54
|
if confirm("Are you sure you want to clear memory of this Agent?")
|
|
|
@@ -61,8 +63,7 @@ class @AgentShowPage
|
61
|
63
|
.fail ->
|
62
|
64
|
$("#memory .spinner").fadeOut ->
|
63
|
65
|
$("#memory .clear").css(display: 'inline-block')
|
64
|
|
-
|
65
|
66
|
|
|
67
|
+
|
66
|
68
|
$ ->
|
67
|
69
|
Utils.registerPage(AgentShowPage, forPathsMatching: /^agents\/\d+/)
|
68
|
|
-
|